package org.itboys.mobile.service.mongo.site;

import org.itboys.mobile.entity.mongo.JoinShop;
import org.itboys.mongodb.core.MongoDataSource;
import org.itboys.mongodb.service.BaseMongoService;
import org.itboys.param.PageResult;
import org.itboys.param.ParamUtil;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 作者：zzq
 * 时间：2017/9/25
 * 描述：雄安加盟网_加盟店
 */
@Service
public class JoinSiteShopService extends BaseMongoService<JoinShop>{
    @Resource(name = "mobileDs")
    private MongoDataSource mobileDataSource;
    @Override
    protected MongoDataSource getMongoDataSource() {
        return mobileDataSource;
    }

    @Override
    protected Class<JoinShop> getEntityClass() {
        return JoinShop.class;
    }

    public PageResult<JoinShop> selectByProductId(HttpServletRequest request, Long productId){
        Map<String,Object> param= ParamUtil.packageMongoExactParam(request);
        Map<String,String> containParam=ParamUtil.packageMongoVagueParam(request);
        param.put("isDeleted",0);
        param.put("productId",productId);
        return super.containpageQuery(request,containParam,param);
    }
}
